package com.edu.web.servlet;


import com.edu.entity.User;
import com.edu.service.Impl.UserServiceImpl;
import com.edu.service.UserService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/zhuCeServlet")
public class zhuCeServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        String userName=req.getParameter("userName");
        String userPw=req.getParameter("userPW");
        String reallyName=req.getParameter("reallyName");
        System.out.println(userName+userPw+reallyName);
        UserService userService=new UserServiceImpl();
        User user=new User();
        user.setUserName(userName);
        user.setUserPW(userPw);
        user.setReallyName(reallyName);
        System.out.println(user);
        userService.insert(user);

    }
}
